<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  	<link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap.min.css" />
		<link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap-responsive.min.css" />
		<link rel="stylesheet"  href="<%=request.getContextPath() %>/css/select2.css" />
		<link rel="stylesheet" href="<%=request.getContextPath() %>/css/uniform.css" />
		<link rel="stylesheet" href="<%=request.getContextPath() %>/css/matrix-style.css" />
		<link rel="stylesheet" href="<%=request.getContextPath() %>/css/matrix-media.css" />
		<link href="<%=request.getContextPath() %>/font-awesome/css/font-awesome.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" media="all" href="<%=request.getContextPath() %>/css/jqGrid/themes/redmond/jquery-ui-1.8.1.custom.css" />
    <link rel="stylesheet" type="text/css" media="all" href="<%=request.getContextPath() %>/css/jqGrid/themes/ui.jqgrid.css" />
		
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.min.js"></script> 
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.ui.custom.js"></script> 
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/bootstrap.min.js"></script> 
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.peity.min.js"></script> 
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/fullcalendar.min.js"></script> 
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.validate.js"></script> 
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.uniform.js"></script> 
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/matrix.popover.js"></script> 
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.dataTables.min.js"></script> 
		
		
    <script src="<%=request.getContextPath() %>/js/jquery/plugin/jquery.layout.js" type="text/javascript"></script>
    <script src="<%=request.getContextPath() %>/js/jquery/jquery-ui/grid.locale-cn.js" type="text/javascript"></script>
    <script src="<%=request.getContextPath() %>/js/jquery/jquery-ui/jquery.jqGrid.min.js" type="text/javascript"></script>
    <script src="<%=request.getContextPath() %>/js/jquery/plugin/jquery.tablednd.js" type="text/javascript"></script>
    <script src="<%=request.getContextPath() %>/js/jquery/plugin/jquery.contextmenu.js" type="text/javascript"></script>
    
  	<script type="text/javascript" src="<%=request.getContextPath() %>/js/lhgdialog/lhgdialog.min.js?skin=iblue"></script>
  	<script type="text/javascript" src="<%=request.getContextPath() %>/js/lhgdialog/dialogUtil.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery/jqGridUtil.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery/jquery-ui/jqGridCRUD.js"></script>
	
	
	
	<script type="text/javascript">
	    jQuery(function(){	    	
	    	var config = {
	           	url:'<%=request.getContextPath() %>/wjgl/stgl/getQuestionList.html',
	           	colModel:[
	           		{label:'id',name:"id",index:'QUESTION_ID', key:true ,hidden:true},
	           		{label:'试题名称',name:"name",index:'QUESTION_NAME',align:"center"},
	           		{label:'关键词',name:"keyword",index:'KEYWORD',align:"center"},
	           		{label:'试题类型',name:"styleId",index:'STYLE_ID',align:"center",formatter:'select',editoptions:{value:"1:单选题;2:复选题"}}
	           	],
	           	table:"#tabGrid",
	           	pager: "#pager",
	            caption:"试题信息列表"
	        };
	    	jQuery.loadGrid(config);
	    	
	    	jQuery("#searchButton").bind("click",searchResult);
	    });
	    
	     function searchResult() {
	    	var map = {};
	    	map["name"] = jQuery('#question_name').val();
			jQuery("#tabGrid").jqGrid('setGridParam',{  
	    	     postData : map
	    	 }).trigger('reloadGrid');
	    }
	     
	     function selectQuesetion(){
	    	 var ids = getChecked();
			 if (ids.length == 0){
				alert('请选择您要插入的试题！');
				return false;
			 }
			 
			 var api = frameElement.api;
			 api.get('parentDialog').insertQuestion(ids.toString());
			 closeDialog();
	     }
	    
	 </script>
  </head>
  
  <body>
    <div class="accordion-group widget-box">
      <div class="accordion-heading">
        <div class="widget-title"> 
        	<a data-parent="#collapse-group" href="#collapseGOne" data-toggle="collapse" class="collapsed">
         	<span class="icon"><i class="icon-search"></i></span>
          	<h5>检索条件</h5>
          	</a> 
        </div>
      </div>
      <div class="accordion-body in collapse" id="collapseGOne" style="height: auto;">
        <div class="form-horizontal">
        	<div class="control-group">
              <div class="search-controls">
              		<label class="control-label2">姓名</label>
              		<input type="text" placeholder="Name" class="span2" id="usernm" >
              		<label class="control-label2">邮箱/手机号码</label>
              		<input type="text" placeholder="Phone or Email" class="span2" id="userPhoneEmail" >
              		<div class="button-search-right">
              			<input type="button" class="btn btn-success" value="检  索" id="searchButton" onclick="searchResult();">
              		</div>
              </div>
            </div>
        </div>
      </div>
    </div>                                                                                                 
    <table id="tabGrid"></table>
    <div id="pager"></div>
   	<div class="modal-footer">
      	<a href="#" id="add-event-submit" class="btn btn-primary" onclick="selectQuesetion();" >确定</a>
     </div>
  </body>
</html>
